package leetcode_1_200;

public class LeeCode_190 {
    public static void main(String[] args) {
        System.out.println(reverseBits(43261596));
    }
    private static int reverseBits(int n) {
        int res = 0;
        for (int i = 0; i < 32; i++) {
            int cur = 1 << i;
            if ((n & cur) != 0){
                res |= 1 << (32 - i - 1);
            }
        }
        return res;
    }
}
